package com.szholly.pro.watergas_server.ps.data;

import java.util.HashMap;

import com.szholly.data.general.Field;
import com.szholly.data.general.InterceptorTableBase;
import com.szholly.data.general.metadata.IBaseTable;
import com.szholly.utils.spring.SpringBeanFactory;
import org.springframework.stereotype.Component;
import com.szholly.data.general.GlobalDataType;
import com.szholly.data.general.RowBase;

/**
 * DetectFile
 */
@Component("DetectFile")
public class DetectFileTable extends InterceptorTableBase implements IBaseTable {

	public final static String TABLE_NAME = "DETECT_FILE";
	
	/**
	 * single ref
	 */
	public static DetectFileTable getSingleRef() {
		return (DetectFileTable) SpringBeanFactory.getBean("DetectFile");
	}

	@Override
	public String getMetadataTableName() {
		return TABLE_NAME;
	}

	@Override
	public String getMetadataTableAliasName() {
		return "DetectFile";
	}

	private HashMap<String, Field> fields;

	@Override
	protected HashMap<String, Field> fields() {
		if (fields == null) {
			fields = new HashMap<String, Field>();

			Field itemField = new Field();
			itemField.setFieldName(RowBase.FIELD_GUID);
			itemField.setDataType(GlobalDataType.String);
			itemField.setFieldID(1);
			itemField.setFieldAliasName("GUID");
			itemField.setCanShow(false);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
			
			itemField = new Field();
			itemField.setFieldName(DetectFileRow.FIELD_DefectAssess);
			itemField.setDataType(GlobalDataType.String);
			itemField.setFieldID(5);
			itemField.setFieldAliasName("DEFECT_ASSESS");
			itemField.setCanShow(false);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
			
			itemField = new Field();
			itemField.setFieldName(DetectFileRow.FIELD_Defect);
			itemField.setDataType(GlobalDataType.String);
			itemField.setFieldID(6);
			itemField.setFieldAliasName("DEFECT");
			itemField.setCanShow(false);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
			
			itemField = new Field();
			itemField.setFieldName(DetectFileRow.FIELD_AttrStatistics);
			itemField.setDataType(GlobalDataType.String);
			itemField.setFieldID(7);
			itemField.setFieldAliasName("ATTR_STATISTICS");
			itemField.setCanShow(false);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
			
			itemField = new Field();
			itemField.setFieldName(DetectFileRow.FIELD_PipePointResult);
			itemField.setDataType(GlobalDataType.String);
			itemField.setFieldID(8);
			itemField.setFieldAliasName("PIPE_POINT_RESULT");
			itemField.setCanShow(false);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
			
			itemField = new Field();
			itemField.setFieldName(DetectFileRow.FIELD_WaterPipeDetectResult);
			itemField.setDataType(GlobalDataType.String);
			itemField.setFieldID(10);
			itemField.setFieldAliasName("WATER_PIPE_DETECT_RESULT");
			itemField.setCanShow(false);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
			
			itemField = new Field();
			itemField.setFieldName(DetectFileRow.FIELD_ReviewResultImg);
			itemField.setDataType(GlobalDataType.String);
			itemField.setFieldID(11);
			itemField.setFieldAliasName("REVIEW_RESULT_IMG");
			itemField.setCanShow(false);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
			
			itemField = new Field();
			itemField.setFieldName(DetectFileRow.FIELD_Detect);
			itemField.setDataType(GlobalDataType.String);
			itemField.setFieldID(12);
			itemField.setFieldAliasName("DETECT");
			itemField.setCanShow(false);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
			
			itemField = new Field();
			itemField.setFieldName(DetectFileRow.FIELD_ProjectNo);
			itemField.setDataType(GlobalDataType.String);
			itemField.setFieldID(13);
			itemField.setFieldAliasName("PROJECT_NO");
			itemField.setCanShow(false);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
		}
		return fields;
	}

	@Override
	public String getTableGroup() {
		return "DetectFile";
	}
}